package com.itheima.mapper;

import com.itheima.pojo.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {
    //查询所有部门
    @Select("select * from dept order by update_time desc")
    List<Dept> selectAllDepts();

    //根据部门id查询部门信息
    @Select("select * from dept where id = #{id}")
    Dept selectDeptById(Integer id);

    //添加部门信息
    void insertDept(Dept dept);

    //更新部门信息
    void updateDept(Dept dept);

    //删除部门信息
    @Delete("delete from dept where id = #{id}")
    void deleteDept(Integer id);
}
